﻿// (c) Norbert Huffschmid
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.

using System;
using System.Collections.Generic;
using System.ServiceModel;
using NProtocol;
using NProtocol.Codec;
using NProtocol.Rtp.Stack;

namespace ShoutBox.Service
{
    /// <summary>
    /// Shoutbox endpoint controller interface
    /// </summary>
    [ServiceContract(SessionMode=SessionMode.Required, CallbackContract=typeof(IShoutBoxEndPointControllerCallback))]
    [ServiceKnownType(typeof(RtpSessionMember))]
    public interface IShoutBoxEndPointController
    {
        /// <summary>
        /// Gets the current shoutbox list
        /// </summary>
        IList<ISessionMember> SessionMembers
        {
            [OperationContract]
            get;
        }


        /// <summary>
        /// Subscribe for notifications
        /// </summary>
        [OperationContract]
        void Subscribe();

        /// <summary>
        /// Unsubscribe from notifications
        /// </summary>
        [OperationContract]
        void Unsubscribe();

        /// <summary>
        /// Start shouting to target
        /// </summary>
        /// <param name="target">Target</param>
        [OperationContract]
        void StartShout(ISessionMember target);

        /// <summary>
        /// Terminate shouting
        /// </summary>
        /// <param name="target">Target</param>
        [OperationContract]
        void EndOfShout(ISessionMember target);

        /// <summary>
        /// Stream shout audio data to remote target
        /// </summary>
        /// <param name="target">Target</param>
        /// <param name="buffer">Audio buffer</param>
        /// <param name="format">Data format</param>
        [OperationContract]
        void StreamShout(ISessionMember target, byte[] buffer, RealTimeDataFormat format);
    }
}
